home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Balloons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  9.2 KB  |  227 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Sunday, January 27, 1991 at 8:21 PM
  5.  Balloons.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1990-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __BALLOONS__
  16. #define __BALLOONS__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22. #ifndef __QUICKDRAW__
  23. #include <Quickdraw.h>
  24. #endif
  25.  
  26. #ifndef __MENUS__
  27. #include <Menus.h>
  28. #endif
  29.  
  30. #ifndef __TRAPS__
  31. #include <Traps.h>
  32. #endif
  33.  
  34.  
  35. enum {
  36.  
  37.  hmBalloonHelpVersion = 0x0002,            /* The real version of the Help Manager */
  38.  
  39. /*Help Mgr error range: -850 to -874*/
  40.  hmHelpDisabled = -850,                    /* Show Balloons mode was off, call to routine ignored */
  41.  hmBalloonAborted = -853,                /* Returned if mouse was moving or mouse wasn't in window port rect */
  42.  hmSameAsLastBalloon = -854,            /* Returned from HMShowMenuBalloon if menu & item is same as last time */
  43.  hmHelpManagerNotInited = -855,            /* Returned from HMGetHelpMenuHandle if help menu not setup */
  44.  hmSkippedBalloon = -857,                /* Returned from calls if helpmsg specified a skip balloon */
  45.  hmWrongVersion = -858,                    /* Returned if help mgr resource was the wrong version */
  46.  hmUnknownHelpType = -859,                /* Returned if help msg record contained a bad type */
  47.  hmOperationUnsupported = -861,            /* Returned from HMShowBalloon call if bad method passed to routine */
  48.  hmNoBalloonUp = -862,                    /* Returned from HMRemoveBalloon if no balloon was visible when call was made */
  49.  hmCloseViewActive = -863,                /* Returned from HMRemoveBalloon if CloseView was active */
  50.  
  51.  kHMHelpMenuID = -16490,                /* Resource ID and menu ID of help menu */
  52.  kHMAboutHelpItem = 1,                    /* help menu item number of About Balloon Help… */
  53.  kHMShowBalloonsItem = 3,                /* help menu item number of Show/Hide Balloons */
  54.  
  55.  kHMHelpID = -5696,                        /* ID of various Help Mgr package resources (in Pack14 range) */
  56.  kBalloonWDEFID = 126,                    /* Resource ID of the WDEF proc used in standard balloons */
  57.  
  58. /* Dialog item template type constant */
  59.  helpItem = 1,                            /* key value in DITL template that corresponds to the help item */
  60.  
  61. /* Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
  62.  hmDefaultOptions = 0,                    /* default options for help manager resources */
  63.  hmUseSubID = 1,                        /* treat resID's in resources as subID's of driver base ID (for Desk Accessories) */
  64.  hmAbsoluteCoords = 2                    /* ignore window port origin and treat rectangles as absolute coords (local to window) */
  65. };
  66. enum {
  67.  hmSaveBitsNoWindow = 4,                /* don't create a window, just blast bits on screen. No update event is generated */
  68.  hmSaveBitsWindow = 8,                    /* create a window, but restore bits behind window when window goes away & generate update event */
  69.  hmMatchInTitle = 16,                    /* for hwin resources, match string anywhere in window title string */
  70.  
  71. /* Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
  72.  kHMStringItem = 1,                        /* pstring used in resource */
  73.  kHMPictItem = 2,                        /* 'PICT' ResID used in resource */
  74.  kHMStringResItem = 3,                    /* 'STR#' ResID & index used in resource */
  75.  kHMTEResItem = 6,                        /* Styled Text Edit ResID used in resource ('TEXT' & 'styl') */
  76.  kHMSTRResItem = 7,                        /* 'STR ' ResID used in resource */
  77.  kHMSkipItem = 256,                        /* don't display a balloon */
  78.  kHMCompareItem = 512,                    /* Compare pstring in menu item w/ PString in resource item ('hmnu' only) */
  79.  kHMNamedResourceItem = 1024,            /* Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) */
  80.  kHMTrackCntlItem = 2048,                /* Reserved */
  81.  
  82. /* Constants for hmmHelpType's when filling out HMMessageRecord */
  83.  khmmString = 1,                        /* help message contains a PString */
  84.  khmmPict = 2,                            /* help message contains a resource ID to a 'PICT' resource */
  85.  khmmStringRes = 3,                        /* help message contains a res ID & index to a 'STR#' resource */
  86.  khmmTEHandle = 4,                        /* help message contains a Text Edit handle */
  87.  khmmPictHandle = 5,                    /* help message contains a Picture handle */
  88.  khmmTERes = 6,                            /* help message contains a res ID to 'TEXT' & 'styl' resources */
  89.  khmmSTRRes = 7,                        /* help message contains a res ID to a 'STR ' resource */
  90.  
  91. /* ResTypes for Styled TE Handles in Resources */
  92.  
  93. #define kHMTETextResType 'TEXT'            /* Resource Type of text data for styled TE record w/o style info */
  94. #define kHMTEStyleResType 'styl'        /* Resource Type of style information for styled TE record */
  95.  
  96. /* Generic defines for the state parameter used when extracting 'hmnu' & 'hdlg' messages */
  97.  
  98.  kHMEnabledItem = 0                        /* item is enabled, but not checked or control value = 0 */
  99. };
  100. enum {
  101.  kHMDisabledItem = 1,                    /* item is disabled, grayed in menus or disabled in dialogs */
  102.  kHMCheckedItem = 2,                    /* item is enabled, and checked or control value = 1 */
  103.  kHMOtherItem = 3,                        /* item is enabled, and control value > 1 */
  104.  
  105. /* Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages */
  106.  
  107. #define kHMMenuResType 'hmnu'            /* ResType of help resource for supporting menus */
  108. #define kHMDialogResType 'hdlg'            /* ResType of help resource for supporting dialogs */
  109. #define kHMWindListResType 'hwin'        /* ResType of help resource for supporting windows */
  110. #define kHMRectListResType 'hrct'        /* ResType of help resource for rectangles in windows */
  111. #define kHMOverrideResType 'hovr'        /* ResType of help resource for overriding system balloons */
  112. #define kHMFinderApplResType 'hfdr'        /* ResType of help resource for custom balloon in Finder */
  113.  
  114. /* Method parameters to pass to HMShowBalloon */
  115.  
  116.  kHMRegularWindow = 0,                    /* Create a regular window floating above all windows */
  117.  kHMSaveBitsNoWindow = 1,                /* Just save the bits and draw (for MDEF calls) */
  118.  kHMSaveBitsWindow = 2                    /* Regular window, save bits behind, AND generate update event */
  119. };
  120.  
  121. struct HMStringResType {
  122.  short hmmResID;
  123.  short hmmIndex;
  124. };
  125.  
  126. typedef struct HMStringResType HMStringResType;
  127.  
  128. struct HMMessageRecord {
  129.  short hmmHelpType;
  130.  union {
  131.   char hmmString[256];
  132.   short hmmPict;
  133.   Handle hmmTEHandle;
  134.   HMStringResType hmmStringRes;
  135.   short hmmPictRes;
  136.   Handle hmmPictHandle;
  137.   short hmmTERes;
  138.   short hmmSTRRes;
  139.   } u;
  140. };
  141.  
  142. typedef struct HMMessageRecord HMMessageRecord;
  143. typedef HMMessageRecord *HMMessageRecPtr;
  144.  
  145.  
  146. #ifdef __cplusplus
  147. extern "C" {
  148. #endif
  149. /*  Public Interfaces  */
  150. pascal OSErr HMGetHelpMenuHandle(MenuHandle *mh)
  151.  = {0x303C,0x0200,_Pack14}; 
  152. pascal OSErr HMShowBalloon(const HMMessageRecord *aHelpMsg,
  153.                            Point tip,
  154.                            RectPtr alternateRect,
  155.                            Ptr tipProc,
  156.                            short theProc,
  157.                            short variant,
  158.                            short method)
  159.  = {0x303C,0x0B01,_Pack14}; 
  160. pascal OSErr HMRemoveBalloon(void)
  161.  = {0x303C,0x0002,_Pack14}; 
  162. pascal Boolean HMGetBalloons(void)
  163.  = {0x303C,0x0003,_Pack14}; 
  164. pascal OSErr HMSetBalloons(Boolean flag)
  165.  = {0x303C,0x0104,_Pack14}; 
  166. pascal OSErr HMShowMenuBalloon(short itemNum,
  167.                                short itemMenuID,
  168.                                long itemFlags,
  169.                                long itemReserved,
  170.                                Point tip,
  171.                                RectPtr alternateRect,
  172.                                Ptr tipProc,
  173.                                short theProc,
  174.                                short variant)
  175.  = {0x303C,0x0E05,_Pack14}; 
  176. pascal OSErr HMGetIndHelpMsg(ResType whichType,
  177.                              short whichResID,
  178.                              short whichMsg,
  179.                              short whichState,
  180.                              long *options,
  181.                              Point *tip,
  182.                              Rect *altRect,
  183.                              short *theProc,
  184.                              short *variant,
  185.                              HMMessageRecord *aHelpMsg,
  186.                              short *count)
  187.  = {0x303C,0x1306,_Pack14}; 
  188. pascal Boolean HMIsBalloon(void)
  189.  = {0x303C,0x0007,_Pack14}; 
  190. pascal OSErr HMSetFont(short font)
  191.  = {0x303C,0x0108,_Pack14}; 
  192. pascal OSErr HMSetFontSize(short fontSize)
  193.  = {0x303C,0x0109,_Pack14}; 
  194. pascal OSErr HMGetFont(short *font)
  195.  = {0x303C,0x020A,_Pack14}; 
  196. pascal OSErr HMGetFontSize(short *fontSize)
  197.  = {0x303C,0x020B,_Pack14}; 
  198. pascal OSErr HMSetDialogResID(short resID)
  199.  = {0x303C,0x010C,_Pack14}; 
  200. pascal OSErr HMSetMenuResID(short menuID,
  201.                             short resID)
  202.  = {0x303C,0x020D,_Pack14}; 
  203. pascal OSErr HMBalloonRect(const HMMessageRecord *aHelpMsg,
  204.                            Rect *coolRect)
  205.  = {0x303C,0x040E,_Pack14}; 
  206. pascal OSErr HMBalloonPict(const HMMessageRecord *aHelpMsg,
  207.                            PicHandle *coolPict)
  208.  = {0x303C,0x040F,_Pack14}; 
  209. pascal OSErr HMScanTemplateItems(short whichID,
  210.                                  short whichResFile,
  211.                                  ResType whichType)
  212.  = {0x303C,0x0410,_Pack14}; 
  213. pascal OSErr HMExtractHelpMsg(ResType whichType,short whichResID,short whichMsg,
  214.  short whichState,HMMessageRecord *aHelpMsg)
  215.  = {0x303C,0x0711,_Pack14}; 
  216. pascal OSErr HMGetDialogResID(short *resID)
  217.  = {0x303C,0x0213,_Pack14}; 
  218. pascal OSErr HMGetMenuResID(short menuID,short *resID)
  219.  = {0x303C,0x0314,_Pack14}; 
  220. pascal OSErr HMGetBalloonWindow(WindowPtr *window)
  221.  = {0x303C,0x0215,_Pack14}; 
  222. #ifdef __cplusplus
  223. }
  224. #endif
  225.  
  226. #endif
  227.